<?php
$this->breadcrumbs=array(
    'Administrar',
    'Questionário'=>array('admin/questionario/admin'),
    $questionario->nome,
    'Gerenciar Questões'
);

$this->menu=array(
    array('label'=>'Nova Questão', 'url'=>array('create','q'=>Yii::app()->request->getQuery('q'))),
);

?>

<h1>Gerenciar Questões</h1>

<p><strong>Questionário: </strong> <?php echo $questionario->nome; ?> (Versão <?php echo number_format($questionario->versao,1); ?>)</p>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'questao-grid',
	'dataProvider'=>$model->search(),
        'template'=>'{items}',
	'columns'=>array(
                array(
                    'name'=>'descricao_questao',
                    'value'=>'$data->descricao_questao',
                ),
                array(
                    'class'=>'CButtonColumn',
                    'template'=>'{alternativa}',
                    'header'=>'Alternativas',
                    'buttons'=>array(
                        'alternativa'=>array(
                            'url'=>'Yii::app()->createUrl("admin/alternativa/admin",array("id_questao"=>$data->id_questao))',
                            'label'=>'Alternativas',
                            'imageUrl'=>Yii::app()->request->baseUrl . '/images/add.png',
                        ),
                    ),
                ),
		array(
                    'class'=>'CButtonColumn',
                    'template'=>'{update}{delete}',
                    'buttons'=>array(
                        'update'=>array(
                            'url'=>'Yii::app()->createUrl("admin/questao/update",array("q"=>Yii::app()->request->getQuery("q"),"id"=>$data->id_questao))',
                        ),
                        'delete'=>array(
                            'url'=>'Yii::app()->createUrl("admin/questao/delete",array("q"=>Yii::app()->request->getQuery("q"),"id"=>$data->id_questao))',
                        ),
                    ),
		),
	),
)); ?>
